package com.wangshuile.ftp;


import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;


/**
 * <p>Description: [类功能描述]</p>
 * Created on 2018/6/6
 *
 * @author 叶向阳
 * @version 1.0
 */
public class FtpCliTest {
    FtpCli ftpCli;
    File file;

    @Before
    public void before() throws IOException {
        ftpCli = FtpCli.createFtpCli("59.40.79.90", 31021,"SzWwb", "488Kh6bc","UTF-8");
        ftpCli.connect();

        //String fileName = "testFtp.tmp";
        //file = new File(fileName);
        //file.createNewFile();
    }

    @After
    public void after() {
        ftpCli.disconnect();
    }

    @Test
    public void uploadFileToDailyDir() throws IOException {
    	System.out.println(ftpCli.listFileNames("/"));
    	
       // String path = ftpCli.uploadFileToDailyDir(file.getName(), new FileInputStream(file));
        //ftpCli.downloadFileFromDailyDir(path , new FileOutputStream(new File("testFtp.txt")));
    }
}